#pragma once

#include "utils.h"

// Setup
void VDSSE_Setup(int lambda, nlohmann::json clientJson);

// IndexBuild
void IndexBuild(nlohmann::json& clientJson, ST& searchTable, Node* verificationList);

void Initialization(nlohmann::json& clientJson);
void BuildST(nlohmann::json& clientJson, ST& searchTable);
void BuildVL(nlohmann::json& clientJson, Node* verificationList);

// GenToken
struct Token {
    std::string pie_w;
    std::string Kw;
    Token(std::string p, std::string k): pie_w(p), Kw(k) {}
};
Token GenToken(std::string w);

// Search
void Search(nlohmann::json& clientJson, Token Tw, ST& searchTable, Node* verificationList, std::vector<int>& Cw_id, std::string ATT);

// Verify
bool Verify(nlohmann::json& clientJson, Token Tw, std::vector<int>& Cw_id, std::string AAT);
